package com.bidevalution.business.checkJob;

import com.bidevalution.business.exception.CheckException;
import com.bidevalution.business.factory.CheckJobBase;
import com.bidevalution.business.service.VoteUnitNumService;
import com.bidevalution.dao.entity.CheckJob;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @Date        2020-04-15 13:16
 */
@Log4j2
@Component
public class VoteUnitNumCheckJob extends CheckJobBase {

    @Autowired
    private VoteUnitNumService voteUnitNumService;

    private static VoteUnitNumCheckJob thisCheckJob;

    @PostConstruct
    public void init() {
        thisCheckJob = this;
    }

    @Override
    public void check(CheckJob checkJob) throws Exception,CheckException {
        try {
            log.info("xxxxxxxxxxxxxxxxxxVoteUnitNumCheckJob");
            thisCheckJob.voteUnitNumService.checkInitiateVote(checkJob.getSectionId(),checkJob.getSectionStepId(),3,1);
        }catch (Exception e){
            throw e;
        }
    }
}
